import unittest

class TestCreateSuit(unittest.TestCase):
    def test_case_one(self):
        print("TestCreateSuit的测试用例方法1。")

    def test_case_two(self):
        print("TestCreateSuit的测试用例方法2。")

    def test_case_three(self):
        print("TestCreateSuit的测试用例方法3。")

if __name__ == '__main__':
    # 使用TestSuite类直接构建
    suite1 = unittest.TestSuite(map(TestCreateSuit, ['test_case_one', 'test_case_two']))

    # 使用addTests方法构建
    suite2 = unittest.TestSuite
    suite2.addTests(map(TestCreateSuit,['test_case_one', 'test_case_two', 'test_case_three']))
    # 使用addTest方法构建
    suite3  = unittest.TestSuite()
    suite3.addTest(TestCreateSuit('test_case_one'))
    suite3.addTest(TestCreateSuit('test_case_two'))

    # 执行测试用例
    unittest.TextTestRunner().run(suite1)
    unittest.TextTestRunner().run(suite2)
    unittest.TextTestRunner().run(suite3)